//
//  ForumCustomNav.m
//  兼职页面
//
//  Created by kuiyuan liang on 2021/6/7.
//

#import "ForumCustomNav.h"
#import "CommonUtil.h"

@interface ForumCustomNav()

@end

@implementation ForumCustomNav

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self addSubview:self.backBtn];
        [self addSubview:self.nameLabel];
        self.backgroundColor = [UIColor whiteColor];
        self.alpha = 0;
    }
    return self;
}


-(UIButton *)backBtn{
    if (!_backBtn) {
        _backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_backBtn setImage:[UIImage imageNamed:@"icon_black_back"] forState:UIControlStateNormal];
        [_backBtn setTitle:@"返回" forState:UIControlStateNormal];
        [_backBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        _backBtn.frame = CGRectMake(AD(10), kStatusBarHeight + AD(7), AD(60), AD(30));
        _backBtn.imageEdgeInsets = UIEdgeInsetsMake(0, AD(-15), 0, 0);
    }
    return _backBtn;
}


-(UILabel *)nameLabel{
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, kStatusBarHeight, SCREEN_WIDTH, kNavBarHeight)];
        _nameLabel.textColor = [UIColor blackColor];
        _nameLabel.font = [UIFont boldSystemFontOfSize:AD(16)];
        _nameLabel.text = @"高手论坛";
        _nameLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _nameLabel;
}

@end
